package com.link.base.base.approval.service;

import com.link.base.base.approval.model.FlowRecord;
import com.link.core.basic.service.BasicService;
import com.link.core.basic.service.BasicServiceException;

import java.util.List;

/**
 * Copyright  hande Company. All Rights Reserved.
 *
 * @author unknwon
 * @version 1.0
 * @date: 2018/11/8 14:42
 */

public interface FlowRecordService extends BasicService<FlowRecord> {

    /**
     * 查询业务对象审批历史
     *
     * @param record
     * @return
     * @throws Exception
     * @throws BasicServiceException
     */
    public List<FlowRecord> queryObjFlowRecordListPage(FlowRecord record) throws BasicServiceException, Exception;

    /**
     * 新建流程记录
     *
     * @param record
     * @throws Exception
     * @throws BasicServiceException
     */
    public void flowRecordInsert(FlowRecord record) throws BasicServiceException, Exception;

    /**
     * 新增审批历史记录信息
     *
     * @param flowId
     * @param approvalNodeId
     * @param operateDesc
     * @param comments
     * @throws Exception
     */
    public void flowRecordInsert(Long flowId, Long approvalNodeId, String operateDesc, String comments) throws Exception;

    /**
     * 查询当前审批节点，本次审核历史记录
     *
     * @param flowId
     * @param approvalNodeId
     * @return
     * @throws Exception
     */
    public List<FlowRecord> queryCurentNodeRecord(Long flowId, Long approvalNodeId) throws Exception;


    /**
     * 根据审批流程id获取最新审批到哪条记录
     *
     * @author 姚江漪
     * @date 2019/07/01 10:07
     */
    public FlowRecord queryLastNodeMaxSn(FlowRecord flowRecord) throws Exception;


}
